import Vue from 'vue'
import VueRouter from 'vue-router'
import baseLayout from '../components/layout/base.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    // component: HomeView
    redirect: '/login'
  },
  {
    path: '/reset-password',
    name: 'reset-password',
    component: () => import(/* webpackChunkName: "password" */ '../views/password/index.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/index.vue')
  },
  {
    path: '/reg',
    name: 'reg',
    component: () => import(/* webpackChunkName: "reg" */ '../views/reg/index.vue')
  },
  {
    path: '',
    component: baseLayout,
    children: [
      {
        path: '/terms',
        name: 'terms',
        component: () => import(/* webpackChunkName: "terms" */ '../views/page/terms.vue')
      },
      {
        path: '/privacy',
        name: 'privacy',
        component: () => import(/* webpackChunkName: "privacy" */ '../views/page/privacy.vue')
      },
      {
        path: '/security',
        name: 'security',
        component: () => import(/* webpackChunkName: "security" */ '../views/page/security.vue')
      }
    ]
  },

]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
